<?php
  // no direct access
  defined( '_JEXEC' ) or die( 'Restricted access' );
  jimport('joomla.application.component.controller');
  require_once JPATH_COMPONENT_ADMINISTRATOR.DS.'xmlconverter.php';
  
  class VideosController extends JController
  {  
    function display(){
    
      $document =& JFactory::getDocument();
      $view = & $this->getView($this->_name, $document->getType());
      
      $video  = $this->getModel('video', 'videomodel');
      $videos = $video->get();
      
      if($videos){
        foreach($videos as $v){
          $v->thumbnail     = $video->get_video_thumbnail($v->video);
          $v->type_instance = $video->get_video_type_instance($v->video_type, $v->video_id);
		}
      }

      $view->assign("videos", $videos);
      $view->display();
    }
    
  }
?>